import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/buyProtocol/addOrSave',
    method: 'post',
    data
  })
}
export function buyProtocol(data) {
  return request({
    url: 'api/buyProtocol',
    method: 'get',
    data
  })
}
export function del(ids) {
  return request({
    url: 'api/buyProtocol',
    method: 'delete',
    data: ids
  })
}
export function removeDetail(id) {
  return request({
    url: 'api/buyProtocol/removeDetail',
    method: 'post',
    data: id
  })
}

export function edit(data) {
  return request({
    url: 'api/buyProtocol/addOrSave',
    method: 'post',
    data
  })
}

export function passOrReject(data) {
  const obj = {
    url: 'api/buyProtocol/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function enableOrDisable(data) {
  const obj = {
    url: 'api/buyProtocol/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}
export function importDe(data) {
  return request({
    url: 'api/buyProtocol/import',
    method: 'post',
    data
  })
}
export function exportDetail(data) {
  return request({
    url: 'api/buyProtocol/exportDetail',
    method: 'get',
    data
  })
}
export function exportDe(data) {
  return request({
    url: 'api/buyProtocol/export',
    method: 'get',
    data
  })
}
export function detail(data) {
  return request({
    url: 'api/buyProtocol/detail',
    method: 'get',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/buyProtocol/copy',
    method: 'get',
    data
  })
}
export default { add, edit, del, passOrReject, removeDetail, importDe, exportDetail, exportDe, detail, copy, buyProtocol, enableOrDisable }
